package me.zhengjie.business.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.Log;
import me.zhengjie.business.domain.Zhsq;
import me.zhengjie.business.domain.sup.Gsgl;
import me.zhengjie.business.service.GsglService;
import me.zhengjie.business.service.ZhsqFpService;
import me.zhengjie.business.service.ZhsqZyService;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @website 复评
 * @author xiahongbo
 * @date 2025-03-25
 **/
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "复评")
@RequestMapping("/api/zhsqFp")
public class ZhsqFpController {

    private final ZhsqFpService zhsqFpService;

    @GetMapping(value = "/getFpTargetDate")
    @Log("获取复评要求的最后一天")
    @ApiOperation("获取复评要求的最后一天")
    public ResponseEntity<Object> getFpTargetDate(@RequestParam Long zhsqId) {
        String date = zhsqFpService.getFpTargetDate(zhsqId, 15, "");
        return new ResponseEntity<>(date, HttpStatus.OK);
    }

    /**
     * 复评
     * @param zhsqId
     * @return
     */
    @PutMapping(value = "/exeFp")
    @Log("确认复评")
    @ApiOperation("确认复评")
    public ResponseEntity<Object> exeFp(@RequestParam Long zhsqId) {

        String msg = zhsqFpService.exeFp(zhsqId);

        return new ResponseEntity<>(msg, HttpStatus.OK);
    }

}
